﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Security.Cryptography;
using System.IO;

namespace it_security_project.App_Code.BusinessLogicLayer
{
    /// <summary>
    /// Info for this class came from online sources
    /// </summary>
    public class Cryptation
    {
        //private static byte[] _salt = Encoding.ASCII.GetBytes("ST0ptrY1ngToH@cKYoUPR!Ck");

        public static string HashPassword(string password)
        {
            SHA1CryptoServiceProvider provider = new SHA1CryptoServiceProvider();
            UnicodeEncoding encoding = new UnicodeEncoding();
            byte[] data = provider.ComputeHash(encoding.GetBytes(password));
            string value =  Encoding.Default.GetString(data, 0, data.Length - 1);
            return value;
        }

    }
}